package com.dorm.mapper;

import com.dorm.entity.HygieneRecord;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface HygieneRecordMapper {
    @Select("SELECT * FROM hygiene_records WHERE room_id = #{roomId}")
    List<HygieneRecord> findByRoomId(Long roomId);

    @Insert("INSERT INTO hygiene_records(room_id, score, comments, check_time) " +
            "VALUES(#{roomId}, #{score}, #{comments}, #{checkTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(HygieneRecord record);

    @Delete("DELETE FROM hygiene_records WHERE id = #{id}")
    int deleteById(Long id);
} 